<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Search Products</title>
</head>
<body>
<header th:replace="common/top"></header>

<div id="BackLink">
    <a th:href="@{/catalog/index}">Return to Main Menu</a>
</div>

<div id="Catalog">
    <table>
        <tr>
            <th>Product ID</th>
            <th>Name</th>
        </tr>
        <!-- Thymeleaf 循环遍历 productList -->
        <tr th:each="product : ${productList}">
            <td>
                <a th:href="@{'/catalog/viewProduct?categoryId=' + ${product.categoryId} + '&productId=' + ${product.productId}}">
                    <span th:text="${product.productId}"></span>
                </a>
            </td>
            <td>
                <span th:text="${product.name}"></span>
            </td>
        </tr>
    </table>
</div>

<footer th:replace="common/bottom"></footer>
</body>
</html>